<template>
	<view class="goods-item" @click="$Router.push({ path: '/pages/goods/detail', query: { id: data.id } })">
		<view class="goods-item__image">
			<image :src="data.image" mode="widthFix" />
		</view>

		<view class="goods-con">
			<view class="goods-item__text1">{{ data.title }}</view>
			<view class="goods-item__text2">￥{{ data.price }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			data: {
				type: Object,
				default: {},
			},
		},
	};
</script>

<style lang="scss" scoped>
	.goods-item {
		width: 332rpx;
		min-height: 426rpx;
		margin-top: 20rpx;
		background: #ffffff;
		border-radius: 16rpx 16rpx 16rpx 16rpx;

		.goods-con {
			padding: 20rpx;
		}

		&__image {
			width: 332rpx;
			height: 248rpx;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
		}

		&__text1 {
			font-weight: bold;
			font-size: 32rpx;
			color: #333333;
			text-align: left;
			font-style: normal;
			text-transform: none;
		}

		&__text2 {
			margin-top: 10rpx;
			font-weight: bold;
			font-size: 32rpx;
			color: #fe7f1a;
			text-align: left;
			font-style: normal;
			text-transform: none;
		}
	}
</style>
